﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BI.CF.Factory;
using BI.CF.Model;
using BI.CF.IDAL;   

namespace BI.CF.BLL
{
    public class UserBLL
    {
        static CF_Factory fac = CF_Factory.DataBaseType();
        UserIDAL idal = fac.UserrsSQL();
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        public bool User_Register(string name,string pwd)
        {
            return idal.User_Register(name,pwd);
        }

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="name">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public UserrsModel User_Login(string name,string pwd)
        {
            return idal.User_Login(name,pwd);
        }
        /// <summary>
        /// 根据借款编号查询借款人具体信息
        /// </summary>
        /// <returns></returns>
        public UserrsModel Get_OnlyUsers(int ID)
        {
            return idal.Get_OnlyUsers(ID);
        }
        /// <summary>
        /// 根据借款编号查询积分信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public IntegralModel Get_OnlyIntegral(int ID)
        {
            return idal.Get_OnlyIntegral(ID);
        }
        /// <summary>
        /// 注册用户是否重复
        /// </summary>
        /// <param name="name">用户名</param>
        /// <returns></returns>
        public int User_RegisterRepeat(string name)
        {
            return idal.User_RegisterRepeat(name);
        }
        /// <summary>
        /// 用户修改密码
        /// </summary>
        /// <returns></returns>
        public int UserPwdUpd(int UserId,string NewPwd)
        {
            return idal.UserPwdUpd(UserId,NewPwd);
        }
        /// <summary>
        /// 用户绑定手机
        /// </summary>
        /// <returns></returns>
        public int UserBinDingPhone(int UserId, string NewPwd)
        {
            return idal.UserBinDingPhone(UserId,NewPwd);
        }
        /// <summary>
        /// 用户绑定邮箱
        /// </summary>
        /// <returns></returns>
        public int UserBinDingEmail(int UserId,string Email)
        {
            return idal.UserBinDingEmail(UserId, Email);
        }
        /// <summary>
        /// 用户绑定邮箱
        /// </summary>
        /// <returns></returns>
        public int UserBinDingBankCard(int UserId, string BankCard)
        {
            return idal.UserBinDingBankCard(UserId, BankCard);
        }


        /// <summary>
        /// 修改用户支付密码
        /// </summary>
        /// <returns></returns>
        public int UserPayPwd_Upd(UserrsModel m)
        {
            return idal.UserPayPwd_Upd(m);
        }

        /// <summary>
        /// 修改前支付密码验证
        /// </summary>
        /// <param name="pwd"></param>
        /// <param name="id"></param>
        /// <returns></returns>
        public int PwdQuery(int pwd, int id)
        {
            return idal.PwdQuery(pwd,id);
        }
    }
}
